/**
 *
 */
package com.kgcx.schedule.rabbitmq.consumer;

import com.kgcx.common.constant.Cons;
import com.kgcx.schedule.client.City;
import com.kgcx.schedule.client.CityClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 袁进勇
 */
@Slf4j
public abstract class AbstractTaskConsumer {

    @Autowired
    protected CityClient cityClient;
    @Autowired
    protected RabbitTemplate rabbitTemplate;

    protected List<City> getCityList() {
        Map<String, Object> params = new HashMap<>();
        params.put("status", Cons.COMMON_STATUS_ACTIVE);
        return cityClient.getCityList(params);
    }
}
